home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 4062 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.3 KB

  1. Path: ix.netcom.com!netnews
  2. From: BHaddock@ix.netcom.com (Brian F. Haddock)
  3. Newsgroups: comp.lang.c++
  4. Subject: Newbie question on these 2 constructor variations
  5. Date: Sat, 27 Jan 1996 17:43:59 GMT
  6. Organization: SparTech Software
  7. Message-ID: <310a6256.34676691@nntp.ix.netcom.com>
  8. NNTP-Posting-Host: ix-ftw-tx2-11.ix.netcom.com
  9. X-NETCOM-Date: Sat Jan 27  9:46:17 AM PST 1996
  10. X-Newsreader: Forte Agent .99d/32.168
  11.  
  12. I'm really confused on something, and can't seem to find any details
  13. on the following type of constructor.  Why does this type of
  14. constructor work...
  15.  
  16. CMyPropertySheet::CMyPropertySheet(LPCTSTR, CWnd* pParent, UINT)
  17.     : CPropertySheet("Game Options", NULL, 0)
  18.  
  19. while this one will not?
  20.  
  21. CMyPropertySheet::CMyPropertySheet(LPCTSTR name, CWnd* pParent, UINT
  22. tmpNum)
  23. {
  24.     name = "Game Options";
  25.     pParent = NULL;
  26.     tmpNum = 0;
  27. }
  28.  
  29. Ignoring any syntax errors I may have made typing this in, what is the
  30. difference in using the ' : ' type of constructor (first example) and
  31. the one that inits the fields between the brackets (second example)?
  32. Are they just 2 different variations of doing the same thing?
  33. --             
  34.                        Brian F. Haddock
  35.                     BHaddock@ix.netcom.com
  36.                    -- SparTech Software --
  37.                     Burleson, Tx USA 76028
  38.